package com.edu.compile.constant;

import java.util.Arrays;

/**
 * @author yanzhao
 * @date 2021/10/21 15:29
 * @since 1.0.0
 */
public enum EventEnum {

    HTTP(NodeTypeEnum.HTTP);

    EventEnum(NodeTypeEnum nodeType) {
        this.nodeType = nodeType;
    }

    private NodeTypeEnum nodeType;

    /**
     * 判断节点类型是否是事件
     *
     * @param nodeType
     * @return
     */
    public static boolean testEvent(String nodeType) {
        return Arrays.stream(EventEnum.values()).anyMatch(event -> event.nodeType.getName().equals(nodeType));
    }
}
